<?php

echo "####".posix_getpid().PHP_EOL;
pcntl_async_signals(true);


$i=0;

\pcntl_signal(SIGINT, 'sigfun', false);
// uninstall graceful stop signal handler
\pcntl_signal(SIGTERM, SIG_IGN, false);
// uninstall reload signal handler
\pcntl_signal(SIGUSR1, SIG_IGN, false);
// uninstall graceful reload signal handler
\pcntl_signal(SIGQUIT, SIG_IGN, false);
// uninstall status signal handler
\pcntl_signal(SIGUSR2, SIG_IGN, false);
// uninstall connections status signal handler
\pcntl_signal(SIGIO, SIG_IGN, false);



function sigfun($signo){
    global  $i;
    $i++;
    echo "    signo=".$signo." i=".$i.PHP_EOL;
    if($i>10){
        exit();
    }

}
while(true){
    echo "i=".$i.PHP_EOL;
    sleep(10);
}












